<?php

/**
 * Calificaciones filter form base class.
 *
 * @package    Fix_Student
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseCalificacionesFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idmateria'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Materias'), 'add_empty' => true)),
      'idestudiante'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estudiantes'), 'add_empty' => true)),
      'nota1'         => new sfWidgetFormFilterInput(),
      'nota2'         => new sfWidgetFormFilterInput(),
      'nota3'         => new sfWidgetFormFilterInput(),
      'observaciones' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'idmateria'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Materias'), 'column' => 'idmateria')),
      'idestudiante'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Estudiantes'), 'column' => 'idestudiante')),
      'nota1'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'nota2'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'nota3'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'observaciones' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('calificaciones_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Calificaciones';
  }

  public function getFields()
  {
    return array(
      'id'            => 'Number',
      'idmateria'     => 'ForeignKey',
      'idestudiante'  => 'ForeignKey',
      'nota1'         => 'Number',
      'nota2'         => 'Number',
      'nota3'         => 'Number',
      'observaciones' => 'Text',
    );
  }
}
